
import java.util.ArrayList;
import java.util.HashMap;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author ilstxfe
 */
public class Tasks {
    private int totalLevels;
    private HashMap<String,ArrayList> upMap;
    private HashMap<String,ArrayList> downMap;

    public Tasks(int levels){
        totalLevels = levels;
        upMap = new HashMap<String,ArrayList>(totalLevels);
        downMap = new HashMap<String,ArrayList>(totalLevels);
    }

    public void addTask(int source, int dest){
        TaskElement element = new TaskElement(source,dest);
        ArrayList<TaskElement> list;

        if(source > dest){
            if(!downMap.containsKey(String.valueOf(source))){
                list = new ArrayList<TaskElement>();
                list.add(element);
                downMap.put(String.valueOf(source),list);
            }else{
                list = downMap.get(String.valueOf(source));
                list.add(element);
            }
        }else if(source < dest){
            if(!upMap.containsKey(String.valueOf(source))){
                list = new ArrayList<TaskElement>();
                list.add(element);
                upMap.put(String.valueOf(source),list);
            }else{
                list = upMap.get(String.valueOf(source));
                list.add(element);
            }
        }//end else if
    }//end addTask

    public void removeTask(){
        
    }
}
